package com.bw.common.base

import android.os.Bundle
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import androidx.databinding.DataBindingUtil
import androidx.databinding.ViewDataBinding

abstract class BaseActivity<VDB:ViewDataBinding> :AppCompatActivity(){
     lateinit var mDataBinding:VDB

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        mDataBinding=DataBindingUtil.setContentView(this,getLayoutId())
        initViews()
    }
    fun showToastMsg(msg:String){
        if(msg.isNotEmpty()){
            Toast.makeText(this,msg,Toast.LENGTH_SHORT).show()
        }
    }
    abstract fun getLayoutId():Int

    abstract fun initViews()
}